package com.acme;

import com.acme.bankapp.domain.account.CheckingAccount;
import com.acme.bankapp.domain.account.SavingAccount;
import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.listeners.email.EmailNotificationListener;
import com.acme.bankapp.listeners.email.EmailService;
import com.acme.bankapp.service.bank.AccountID;
import com.acme.bankapp.service.bank.BankService;
import com.acme.bankapp.service.bank.Gender;

public class BankApplication {
	public static void main(String[] args) {
		
		Bank bank = new Bank();
		BankService bankserv = new BankService();
		EmailService emservice = new EmailService();

		bank.addListener(new EmailNotificationListener(emservice));

		Client cl1 = new Client("Petrov", Gender.MALE, 45);
		Client cl2 = new Client("Ivanov", Gender.MALE, 24);
		Client cl3 = new Client("Sidorova", Gender.FEMALE, 36);
		
		cl1.addAcc(new SavingAccount(AccountID.set(), 2000));
		cl2.addAcc(new CheckingAccount(AccountID.set(), 2000, 1478));
		cl3.addAcc(new SavingAccount(AccountID.set(), 40000));
		
		bankserv.addClient(bank, cl1);
		bankserv.addClient(bank, cl2);
		bankserv.addClient(bank, cl3);

		emservice.close();
	}
}
